 function myFunction() {
 	myVar = setTimeout(function() {
 		x_admin_close();
 	}, 1500);
 };

 function myStopFunction() {
 	clearTimeout(myVar);
 };
 //新增链接
 var adress = window.location.href.split('?');

 var aid = adress[1].split("=")[1];
 //修改前账号，密码
 $("#username").val(adress[2].split("=")[1]);
 $("#pass").val(adress[3].split("=")[1]);
 $(".changeaccount").click(function() {

 	var username = $("#username").val();
 	var passward = $("#pass").val();

 	if(username == '' || passward == '') {
 		layer.msg('账号或者密码不能为空！');
 	} else if(username.length > 10 || passward.length > 10) {
 		layer.msg('账号或者密码长度不能大于10！');
 	} else {
 		$.post('/api/admin/v1/updadmin.action', {
 			'aid': aid,
 			'acc': username,
 			'pass': passward
 		}, function(data) {

 			if(data.code == 0) {
 				layer.msg(data.msg);

 				index = parent.index;
 				parent.getAdministorDate(index);
 				myFunction();

 				$("#username").val("");
 				$("#pass").val("");
 			} else {
 				layer.msg(data.msg);
 				myStopFunction();
 			}
 		});

 	}

 });